package de.pnp.kniffel.tasks;


/**
 * Klasse zum Erzeugen von Task-Objekten.
 * 
 * @author Peter
 */
public class TaskFactory {
	/**
	 * Factory-Methode zum Erzeugen von konkreten Objekten des Typs Task.
	 * 
	 * @param type
	 *            Typ des zu erzeugenden Objekts.
	 * @return Erzeugtes Objekt.
	 */
	public static Task CreateTask(TaskType type) {
		switch (type) {
		case ACES:
			return new TaskAces();
		case TWOS:
			return new TaskTwos();
		case THREES:
			return new TaskThrees();
		case FOURS:
			return new TaskFours();
		case FIVES:
			return new TaskFives();
		case SIXES:
			return new TaskSixes();
		case THREE_OF_A_KIND:
			return new TaskThreeOfAKind();
		case FOUR_OF_A_KIND:
			return new TaskFourOfAKind();
		case FULL_HOUSE:
			return new TaskFullHouse();
		case SMALL_STRAIGHT:
			return new TaskSmallStraight();
		case LARGE_STRAIGHT:
			return new TaskLargeStraight();
		case YAHTZEE:
			return new TaskYahtzee();
		case CHANCE:
			return new TaskChance();
		default:
			return null;
		}
	}
}
